#include <stdio.h>

struct Student {
    int num;
    char name[20];
    int s1, s2, s3;
    double avg;
};

int main() {
    int n;
    scanf("%d", &n);
    struct Student stu[10];
    for (int i = 0; i < n; i++) {
        scanf("%d %s %d %d %d", &stu[i].num, stu[i].name, &stu[i].s1, &stu[i].s2, &stu[i].s3);
        stu[i].avg = (stu[i].s1 + stu[i].s2 + stu[i].s3) / 3.0;
    }
    int maxIdx = 0;
    for (int i = 1; i < n; i++) {
        if (stu[i].avg > stu[maxIdx].avg)
            maxIdx = i;
    }
    printf("num:%d,name:%s,average:%.2f\n", stu[maxIdx].num, stu[maxIdx].name, stu[maxIdx].avg);
    return 0;
}
